﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.Windows.Controls;
using Farmacie.Managers;
using Farmacie.Controls;

namespace Farmacie
{
    public class MainViewModel : ViewModelBase
    {
        private bool isVanzareSelected = true;
        private bool isMedicamenteSelected;
        private bool isArhivaSelected;
        private bool isStocCriticSelected;
        private bool isRaportVanzariSelected;
        private bool isComenziSelected;
        private bool isChitanteSelected;

        public bool IsVanzareSelected
        {
            get { return isVanzareSelected; }
            set
            {
                if (value != isVanzareSelected)
                {
                    isVanzareSelected = value;
                    OnPropertyChanged<bool>(() => IsVanzareSelected);

                    if (isVanzareSelected)
                        ControlVanzare.RefreshControl();
                }
            }
        }

        public bool IsMedicamenteSelected
        {
            get { return isMedicamenteSelected; }
            set
            {
                if (value != isMedicamenteSelected)
                {
                    isMedicamenteSelected = value;
                    OnPropertyChanged<bool>(() => IsMedicamenteSelected);

                    if (isMedicamenteSelected)
                        ControlMedicamente.RefreshGrid();
                }
            }
        }

        public bool IsArhivaSelected
        {
            get { return isArhivaSelected; }
            set
            {
                if (value != isArhivaSelected)
                {
                    isArhivaSelected = value;
                    OnPropertyChanged<bool>(() => IsArhivaSelected);

                    if (isArhivaSelected)
                        ControlArhiva.RefreshControl();
                }
            }
        }

        public bool IsStocCriticSelected
        {
            get { return isStocCriticSelected; }
            set
            {
                if (value != isStocCriticSelected)
                {
                    isStocCriticSelected = value;
                    OnPropertyChanged<bool>(() => IsStocCriticSelected);

                    if (isStocCriticSelected)
                        ControlStocCritic.RefreshControl();
                }
            }
        }

        public bool IsRaportVanzariSelected
        {
            get { return isRaportVanzariSelected; }
            set
            {
                if (value != isRaportVanzariSelected)
                {
                    isRaportVanzariSelected = value;
                    OnPropertyChanged<bool>(() => IsRaportVanzariSelected);

                    if (isRaportVanzariSelected)
                        ControlRaportVanzari.RefreshControl();
                }
            }
        }

        public bool IsComenziSelected
        {
            get { return isComenziSelected; }
            set
            {
                if (value != isComenziSelected)
                {
                    isComenziSelected = value;
                    OnPropertyChanged<bool>(() => IsComenziSelected);

                    if (isComenziSelected)
                        ControlComenzi.RefreshControl();
                }
            }
        }

        public bool IsChitanteSelected
        {
            get
            {
                return isChitanteSelected;
            }
            set
            {
                if (value != isChitanteSelected)
                {
                    isChitanteSelected = value;
                    OnPropertyChanged<bool>(() => isChitanteSelected);

                    if (isChitanteSelected)
                        DetaliiChitante.RefreshData();
                }
            }
        }

        #region Vanzare

        public VanzareControl ControlVanzare { get; set; }

        public Medicamente ControlMedicamente { get; set; }

        public ArhivaGraphic ControlArhiva { get; set; }

        public StocCritic ControlStocCritic { get; set; }

        public RaportVanzari ControlRaportVanzari { get; set; }

        public ComenziControl ControlComenzi { get; set; }

        public DetaliiChitante DetaliiChitante { get; set; }

        public IncasariManager IncasariManager
        {
            get { return IncasariManager.Instance; }
        }

        #endregion
    }
}
